package com.seed.application.datasourcekey;

import com.seed.core.enumeration.AppMode;

public class DataSourceKeyContext {
    private final DataSourceKeyStrategy strategy;

    public DataSourceKeyContext(AppMode mode) {
        this.strategy = switch (mode) {
            case dev -> new DevDataSourceKeyStrategy();
            case single -> new SingleDataSourceKeyStrategy();
            default -> new DefaultDataSourceKeyStrategy();
        };
    }

    public String getResult(String tenantname) {
        return strategy.getResult(tenantname);
    }
}
